package com.kaishengit.util;

import java.util.List;
public class Page<T> {
	private int pageNum;
	private int pageSize;
	private long totalPage;
	private long totalCount;
	private int offest;
	private List<T> list;
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list2) {
		this.list = list2;
	}
	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
		long result = getTotalCount()/getPageSize();
		if(getTotalCount()% getPageSize() !=0){
			result +=1;
		}
		setTotalPage(result);
	}
	public int getPageNum() {
		return pageNum;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
		
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
		setOffest((this.pageNum-1)*getPageSize());
		
	}
	public long getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}
	public long getTotalCount() {
		return totalCount;
	}
	public int getOffest() {
		return offest;
	}
	public void setOffest(int offest) {
		this.offest = offest;
	}
}
